<%-- 
    Document   : check
    Created on : 15-feb-2012, 23:16:21
    Author     : Deico
--%>

<%@page import="validacion.vrut"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.*,java.io.*,java.lang.*,java.sql.*,usuario.login"%>
    
    <%
        String user=request.getParameter("user"); 
        String pass=request.getParameter("pass");
        if(login.isUser(user) && pass.equals(login.getPass(user)))        
        {
            HttpSession sesion=request.getSession();
            sesion.setAttribute("user",user);
            sesion.setAttribute("pass",pass);
            sesion.setAttribute("tipo",login.getTipo(user));
    %>
        <jsp:forward page="index.jsp">
            <jsp:param name="Correcto" value="Validacion correcta"/>                
        </jsp:forward>
    <%        
            }
            else
            {
                 %>
        <jsp:forward page="error.jsp">
            <jsp:param name="Error" value="Es Obligatorio identificarse"/>                
        </jsp:forward>
    <% 
            }   
     %>
